﻿<%@ Page Language="C#" MasterPageFile="~/Management.master" AutoEventWireup="true" CodeFile="employeeView.aspx.cs" Inherits="employeeView"%>
<%@ Register Assembly="EclipseWebSolutions.DatePicker" Namespace="EclipseWebSolutions.DatePicker"
    TagPrefix="ews" %>
<%@ Register assembly="StrengthControls.Scrolling" namespace="StrengthControls.Scrolling" tagprefix="cc1" %>
<%@ Register assembly="GridViewSortIndicatorSample" namespace="GuiHelpers" tagprefix="cc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="conSearch" Runat="Server">

    &nbsp;
            <div class="AccordionPanel">
        	    <div class="AccordionPanelTab"><b class="contentcolor"><asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/indicator.png" />Employee</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </div>
        	    <div class="AccordionPanelContent">
        	      <br />
                          <div style="height:50px">
                    
                    
         <asp:Label ID="Label3" runat="server" Text="Employee's Name"></asp:Label><br />
         <asp:TextBox ID="txtEmployeeName" runat="server" Height="17px" 
                          Width="189px"></asp:TextBox>
&nbsp;   
         <br />
     &nbsp;<br />
         
          </div>            
                    <div style="height:50px">
                    
         <asp:Label ID="Label1" runat="server" Text="Group"></asp:Label>
        
&nbsp;<asp:DropDownList ID="drdGroup" runat="server" Height="25px" Width="195px" 
             AppendDataBoundItems="True" DataSourceID="odsGroup" 
             DataTextField="GroupLabel" DataValueField="GroupId" 
            >
             <asp:ListItem Value="-1">--- Choose Group ---</asp:ListItem>
         </asp:DropDownList>
         
         <asp:ObjectDataSource ID="odsGroup" runat="server" SelectMethod="GetUserGroups" 
             TypeName="Service.ReferenceDataService"></asp:ObjectDataSource>
         
         <br />
     &nbsp;<br />
         
          </div>
     
            <div style="height:50px">
                    
                    
         <asp:Label ID="Label4" runat="server" Text="Company name"></asp:Label>
        
&nbsp;<asp:DropDownList ID="drlCompanyName" runat="server" Height="25px" Width="195px" 
             AppendDataBoundItems="True" DataSourceID="odsCompany" 
             DataTextField="CompanyLabel" DataValueField="CompanyId" 
            >
             <asp:ListItem Value="-1">--- Choose company ---</asp:ListItem>
         </asp:DropDownList>
         
         <asp:ObjectDataSource ID="odsCompany" runat="server" SelectMethod="GetCompanies" 
             TypeName="Service.ReferenceDataService"></asp:ObjectDataSource>
         
         <br />
     &nbsp;<br />
         
                
         
          </div>
                    <div style="height: 51px">
             &nbsp;<asp:Label ID="Label2" runat="server" Text="Department"></asp:Label>
             
&nbsp;<asp:DropDownList ID="drdDepartment" runat="server" Height="25px" Width="195px" 
                 AppendDataBoundItems="True" DataSourceID="odsDepartment" 
                 DataTextField="DepartmentLabel" DataValueField="DepartmentId">
                 <asp:ListItem Value="-1">--- Choose Department ---</asp:ListItem>
             </asp:DropDownList>
             <asp:ObjectDataSource ID="odsDepartment" runat="server" 
                 SelectMethod="GetDepartments" TypeName="Service.ReferenceDataService">
             </asp:ObjectDataSource>
             <div>
                <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                 <asp:Button BorderStyle="Dotted" ID="bntFilter" 
                     runat="server" Text="Search" onclick="bntFilter_Click" 
                     CssClass="btnexpress" />
             </div>
         </div>
     </div> 
 </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="m_contentBody" Runat="Server">

 <body  onload ="TabbedPanels1.showPanel(<%=GetTabIndex()%>)">
 
         <asp:TextBox ID="txtHiddenEmployeeId" runat="server" Width="77px" 
            Visible="False"></asp:TextBox>                          
    <div id="containerright" class="containerright">
          <div id="TabbedPanels1" class="TabbedPanels">
                <ul class="TabbedPanelsTabGroup">
                  <li class="TabbedPanelsTab" tabindex="0">List employees</li>
                  <li class="TabbedPanelsTab" tabindex="1">Employee's detail</li>
                  <li class="TabbedPanelsTab" tabindex="2">Employee's equipment</li>    
                </ul>
              <div class="TabbedPanelsContentGroup">

                  <div class="TabbedPanelsContent" style="width:auto; height:400px">
                  
                
<table  class="GridItem" cellspacing="2" cellpadding="2" style="width:auto;height:350px">
  <tr><td align="center" class="BigLabel" >
       
         <asp:Label ID="lblTotalEmployee" runat="server" Text="Label"></asp:Label> <asp:Label ID="lblPermission" runat="server" CssClass="permissionstyle"></asp:Label>
         <br />
          <br />
                               
        </td></tr>
    <tr>
             <td  align="center" class="GridItem"  style="text-align:center">
             <asp:GridView ID="grdGroupeSoftware1" runat="server" AllowPaging="True" Width="750px" 
                     AutoGenerateColumns="False"  Visible ="False" DataSourceID="dsMessage" 
                     
                     CellPadding="4" ForeColor="#333333" GridLines="None" PageSize="3">
                 <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                 <RowStyle BackColor="#EFF3FB" />
                 <Columns>
                     <asp:BoundField DataField="Label" />
                 </Columns>
             
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                   <RowStyle BackColor="#EFF3FB" />
                   <SelectedRowStyle BackColor="#FF5050" />
                   <HeaderStyle BorderStyle="None" CssClass="GridViewHeader" Height="20px" 
                        Width="30px" />
                        
                    <PagerStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    <EditRowStyle BackColor="LightGray" />
                    <RowStyle CssClass="AlternativeRowStyle" />
                    <AlternatingRowStyle BackColor="White" CssClass="AlternativeRowStyle" />
                    
                 
             </asp:GridView >
             
                 <asp:ObjectDataSource ID="dsMessage" runat="server" SelectMethod="GetMessage" 
                     TypeName="DirectService"></asp:ObjectDataSource>
             <br />
             </td>    
         </tr>         
        
<tr><td align="center" class="GridItem" >
<asp:UpdatePanel ID="updatePanelEmployee" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
        


<div style=" height:350px; width:auto; overflow:auto">          
                <asp:GridView ID="grdEmployee" runat="server" AllowPaging="True" 

                    AllowSorting="True" AutoGenerateColumns="False" BorderStyle="None" 
                    CssClass="GridItem" DataKeyNames="EmployeeId" DataSourceID="Employees" 
                    onpageindexchanged="grdEmployee_PageIndexChanged1" 
                    OnPageIndexChanging="grdEmployee_PageIndexChanging" 
                    onrowcancelingedit="grdEmployee_RowCancelingEdit" 
                    onrowdatabound="grdEmployee_RowDataBound1" 
                    onrowediting="grdEmployee_RowEditing" 
                    onselectedindexchanged="grdEmployee_SelectedIndexChanged" 
                    RowHeaderColumn="EmployeeId" width="720px" 
                    onrowcommand="grdEmployee_RowCommand">
                    <HeaderStyle BorderStyle="None" CssClass="GridViewHeader" Height="20px" />
                    <Columns>
                        <asp:CommandField ShowSelectButton="True" />
                        <asp:TemplateField>
                            <ItemTemplate>
                                <a title="Detail" href='employeeView.aspx?detail=false&amp;tabIndex=1&amp;employeeId=<%# DataBinder.Eval(Container.DataItem, "EmployeeId") %>&amp;pageIndex=<%=GetPageIndex()%>'>
                                <img border="0" height="20" src="images/b_view.png" width="20"> </img></a>
                            </ItemTemplate>
                            <ItemStyle Width="15px" Wrap="True" />
                        </asp:TemplateField>
                    
                        
                        <asp:TemplateField>
                            <ItemTemplate>
                                <a  title="Delete" href="javascript:confirmDelete('employeeView.aspx?delete=true&tabIndex=0&employeeId=<%# DataBinder.Eval(Container.DataItem,"EmployeeId")%>&pageIndex=<%=GetPageIndex()%>')">
                                <img border="0" height="15" src="images/del.png" width="15"> </img></a>
                            </ItemTemplate>
                            <ItemStyle Width="15px" />
                        </asp:TemplateField>
                        
                        <asp:TemplateField >
                            <ItemTemplate >  
                                <a title="Equipment" href="employeeView.aspx?tabIndex=2&employeeId=<%# DataBinder.Eval(Container.DataItem, "employeeId") %> &pageIndex=<%=GetPageIndex()%>)" > 
                               <img border=0 src="./images/admin3.png" width="20" height="20">
                              </a> 
                            </ItemTemplate>
                            <ItemStyle Width="15px" />
                        </asp:TemplateField>
                        
                       
                        
                        <asp:BoundField DataField="EMPLOYEEID" HeaderText="N°" 
                            SortExpression="EMPLOYEEID">
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:BoundField>
                        <asp:BoundField DataField="EMPLOYEENAME" HeaderText="Name" 
                            SortExpression="EMPLOYEENAME">
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:BoundField>
                        <asp:BoundField DataField="NOMGROUPE" HeaderText="Group" 
                            SortExpression="NOMGROUPE" >
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:BoundField>
                        <asp:BoundField DataField="EMPLOYEEEMAILADRESS" HeaderText="E-mail" 
                            SortExpression="EMPLOYEEEMAILADRESS">
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:BoundField>
                        <asp:BoundField DataField="USERNAME" HeaderText="User name" 
                            SortExpression="USERNAME" >
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:BoundField>
                        <asp:BoundField DataField="departmentName" HeaderText="Department" 
                            SortExpression="departmentName">
                            <ItemStyle Width="150px" HorizontalAlign="Left" />
                        </asp:BoundField>
                    </Columns>
                    <PagerStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    <EditRowStyle BackColor="LightGray" />
                    <RowStyle CssClass="AlternativeRowStyle" />
                    <AlternatingRowStyle BackColor="White" CssClass="AlternativeRowStyle" />
     </asp:GridView>         
</div>
                <cc2:GridViewSortExtender ID="GridViewSortExtender1" runat="server" 
                    AscendingImageUrl="~/images/Ascending.gif" 
                    DescendingImageUrl="~/images/Descending.gif" ExtendeeID="grdEmployee">
                </cc2:GridViewSortExtender>
                <asp:ObjectDataSource ID="Employees" runat="server" SelectMethod="GetEmployees" 
                    TypeName="DirectService" onselected="Employees_Selected">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="txtHiddenWhereClause" Name="whereClause" 
                            PropertyName="Text" Type="String" />
                    </SelectParameters>
                </asp:ObjectDataSource>
    <tr><td>
    <asp:TextBox ID="txtHiddenPageIndex" runat="server" Visible="False"></asp:TextBox>
    <a id="detailPosition"></a>
       <asp:TextBox ID="txtHiddenWhereClause" runat="server" Height="17px" Width="205px" Visible="False"></asp:TextBox>
       <asp:TextBox ID="txthiddenOrderbyClause" runat="server"  Width="77px" 
            Visible="False"></asp:TextBox>
              <Triggers>
                <asp:AsyncPostBackTrigger ControlID="txtHiddenWhereClause" EventName="TextChanged" />
                
            </Triggers>
            <Triggers>
            <asp:AsyncPostBackTrigger ControlID="txthiddenOrderbyClause" EventName="TextChanged" />
            </Triggers>
            <Triggers>
            <asp:AsyncPostBackTrigger ControlID="Timer1" />
            </Triggers>
        	    </ContentTemplate>
        	    </asp:UpdatePanel>
        </td></tr>
    </table>
                
                  </div>
                                        
                  <div class="TabbedPanelsContent" style="width:700px; height:400px">
                      <iframe src="employeeAdd.aspx?employeeId=<%=txtHiddenEmployeeId.Text%>" width="100%" height="400px" frameborder="0" style="border:0px"></iframe></div><!--This content will be included not use Iframe when using dynamique programing-->        
                 
                   <div class="TabbedPanelsContent" >
                        <iframe  class="FrameDimension" src="EmployeeEquipment.aspx?&employeeId=<%=GetEmployeeId()%>"  frameborder="0" ></iframe></div>
          </div>
    </div>
 </div>
 <script type="text/javascript">
    var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
    
 </script>
 
 <asp:Timer ID="Timer1" OnTick="Timer1_Tick" runat="server" Interval="3000" />
       

       
 </body>
</asp:Content>

